from django.urls import reverse


def filter_reverse(request, url_name):
    # 接收传入的URL参数，并附在跳转URL上
    _filter = request.GET.get('_filter')
    if not _filter:
        param = ''
    else:
        param = '?' + _filter
    return reverse(url_name) + param
